layui.define(['jquery', 'table', 'util'], function (exports) {
    var $ = layui.jquery
    var util = layui.util
    var base = {
        //获取form表单json数据
        serializeObject: function (e) {
            var o = {};
            var a = e.serializeArray();
            $.each(a, function (index, element) {
                o[element.name] = element.value || ''
            });
            return o;
        },
        //时间戳转换
        toDateString: function (date) {
            if (date == null || date == "undefined" || date == '') return ''
            return util.toDateString(date)
        },
        //从第一页重载表格
        reload: function (tableIns, p) {
            tableIns.reload({})
        }
    }
    exports('base', base);
});